package unit4.part12.ticTacToe;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        Competition competition = new Competition("A", "B", n);

        String text = scanner.next();
        String[] strs = text.split(";");
        for (String str : strs) {
            String[] position = str.split(",");
            competition.run(Integer.parseInt(position[0]), Integer.parseInt(position[1]));
        }

        competition.result();
    }
}
